import request from '@/config/axios'

export interface CarVO {
  id: number
  driver: string
  carType: string
  carNumber: string
  mobilePhone: string
}

// 查询车辆管理列表
export const getCarPage = async (params) => {
  return await request.get({ url: `/system/car/page`, params })
}

// 查询车辆管理详情
export const getCar = async (id: number) => {
  return await request.get({ url: `/system/car/get?id=` + id })
}

// 新增车辆管理
export const createCar = async (data: CarVO) => {
  return await request.post({ url: `/system/car/create`, data })
}

// 修改车辆管理
export const updateCar = async (data: CarVO) => {
  return await request.put({ url: `/system/car/update`, data })
}

// 删除车辆管理
export const deleteCar = async (id: number) => {
  return await request.delete({ url: `/system/car/delete?id=` + id })
}

// 导出车辆管理 Excel
export const exportCar = async (params) => {
  return await request.download({ url: `/system/car/export-excel`, params })
}
